#!/bin/bash

echo "🚀 开始数据库字段迁移流程..."
echo ""

# 步骤1: 检查当前状态
echo "📋 步骤1: 检查数据库当前状态"
echo "=================================="
node check-database-columns.js

echo ""
echo "按任意键继续执行迁移..."
read -n 1 -s

# 步骤2: 执行迁移
echo ""
echo "🔄 步骤2: 执行数据库迁移"
echo "=================================="
node migrate-all-tables.js

echo ""
echo "按任意键继续验证结果..."
read -n 1 -s

# 步骤3: 验证迁移结果
echo ""
echo "✅ 步骤3: 验证迁移结果"
echo "=================================="
node verify-migration.js

echo ""
echo "🎉 迁移流程完成！"
echo ""
echo "📝 接下来需要执行以下步骤："
echo "1. 重启应用程序"
echo "2. 测试功能是否正常"
echo "3. 检查应用程序日志"

